package net.learn.piggy.web.controller;

import org.springframework.boot.ApplicationArguments;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;

@Controller
public class LearnController {
    @Resource
    private ApplicationArguments applicationArguments;
    @Resource
    private GenericApplicationContext context;

    @ResponseBody
    @RequestMapping("test1")
    public String test1(){
        String[] sourceArgs = applicationArguments.getSourceArgs();
        return "@test1";
    }

    @ResponseBody
    @RequestMapping("test2")
    public String test2(int[] name){
        String[] sourceArgs = applicationArguments.getSourceArgs();
        return "@test2";
    }
}
